var e = "http://oibl5dyji.bkt.clouddn.com/", n = {
  PHOTOS: e + "0723_upload_pic.png",
  AUDIO: e + "0723_upload_audio.png",
  IMPORT: e + "0723_upload_import.png",
  WRITE: e + "0723_upload_text.png",
  CLOSE: e + "PM_close@2x.png",
  VIDEO: e + "0723_upload_video.png",
  MAKE_MV: e + "0723_upload_mv.png",
  EVENT: e + "0723_upload_event.png",
  LOCATION: e + "0909_location_card.png",
  JOIN_LIST: e + "join_list080919.png"
}, t = [{
  id: 9,
  name: "join_list",
  icon: n.JOIN_LIST,
  desc: "上榜"
}, {
  id: 1,
  name: "photo",
  icon: n.PHOTOS,
  desc: "照片"
}, {
  id: 2,
  name: "video",
  icon: n.VIDEO,
  desc: "视频"
}, {
  id: 3,
  name: "text",
  icon: n.WRITE,
  desc: "说说"
}, {
  id: 4,
  name: "audio",
  icon: n.AUDIO,
  desc: "语音"
}, {
  id: 5,
  name: "event",
  icon: n.EVENT,
  desc: "事件"
}, {
  id: 6,
  name: "make_mv",
  icon: n.MAKE_MV,
  desc: "制作MV"
}, {
  id: 7,
  name: "import",
  icon: n.IMPORT,
  desc: "一键导入"
}, {
  id: 8,
  name: "location",
  icon: n.LOCATION,
  desc: "位置打卡"
}], a = void 0;

Component({
  properties: {
    on: {
      type: Boolean,
      value: !1,
      observer: function (e, n) {
        e && setTimeout(function () {
          a.setData({
            backgroundOn: !0,
            selectedMenuName: ""
          });
        }, 100);
      }
    },
    backgroundOn: {
      type: Boolean,
      value: !1,
      observer: function (e, n) {
        e && a.setData({
          mainOn: !0
        }), e || setTimeout(function () {
          a.setData({
            on: !1
          });
        }, 300);
      }
    },
    mainOn: {
      type: Boolean,
      value: !1,
      observer: function (e, n) {
        e || a.setData({
          backgroundOn: !1
        });
      }
    },
    menuNames: {
      type: String,
      value: "",
      observer: function (e, n) {
        a.generateMenus();
      }
    }
  },
  data: {
    menus: Array,
    selectedMenuName: ""
  },
  created: function () {
    a = this;
  },
  ready: function () {
    a.setData({
      ICON: n
    }), a.generateMenus();
  },
  methods: {
    close: function () {
      a.setData({
        mainOn: !1
      }), setTimeout(function () {
        a.triggerEvent("Close", a.data.selectedMenuName);
      }, 150);
    },
    generateMenus: function () {
      if (a.data.menuNames.length > 0) {
        var e = t.filter(function (e) {
          return a.data.menuNames.search(e.name) >= 0;
        });
        a.setData({
          menus: e
        });
      }
    },
    selectedOperation: function (e) {
      var n = e.currentTarget.dataset.menu_name;
      // a.setData({
      //   selectedMenuName: n
      // }), a.close();
      this.setData({
        on:false
      })
      a.close();

    },
    prevent: function () { }
  }
});